<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div align="center">
    <input type="hidden" id="id" name="id">
    <textarea rows="30" cols="80" name="content" id="content" >
    </textarea>
    <input type="button" class="bt" value="提交">
</div>
</body>
</html>
<script src="statics/jquery-1.8.3.min.js"></script>
<script>
    $(function () {
        var href=location.href
        var id=href.substring(href.indexOf("=")+1);
        $.ajax({
            url:"toaddes",
            type:"GET",
            data:{"id":id},
            dataType:"JSON",
            success:function (re) {
                $("#id").val(re.id);
                $("#content").val(re.content);
            }
        })
        $(".bt").click(function () {
            var id=$("#id").val();
            var content=$("#content").val();
            alert(content);
            $.ajax({
                url:"addes",
                type:"GET",
                data:{"content":content,"id":id},
                dataType:"JSON",
                success:function (re) {
                    if(re==1){
                        alert("评论成功!");
                    }else{
                        alert("评论失败!");
                    }
                }
            })
        })
    })
</script>